<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>用户中心_{$web_name}</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="Keywords" content="用户中心" />
		<meta name="Description" content="用户中心" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
		<meta name="format-detection" content="telephone=no">
		<tc_include file="Public:head" />
		<link rel="stylesheet" type="text/css" href="/themes/wnsc/Home/User/css/user.css" />
		<link rel="stylesheet" type="text/css" href="/themes/wnsc/Home/User/css/user_common.css" />
		<link rel="stylesheet" type="text/css" href="/themes/wnsc/Home/User/css/order.css" />
		<style type="text/css">
			.user-right .tabmenu {
				margin-bottom: 0;
			}
		</style>
	</head>

	<body>

		<tc_include file="Public:nav" />
		<div class="w990 content" id="content" style="background: none;">
			<div class="margin-w1210 clearfix">
				<div class="w">
					<div class="breadcrumb clearfix">
						<a href="/" class="index">首页</a> <span class="crumbs-arrow">&gt;</span> <span class="last">订单管理</span></div>
				</div>
				<div class="blank"></div>
				<tc_include file="Public:user_left" />
				<div class="user-right  con-right">
					<div class="con-right-text">
						<div class="tabmenu">
							<ul class="tab">
								<li class="active">订单详情</li>
							</ul>
						</div>

						<div class="content-info">
							<div class="order-step">
								<!--完成步骤为dl添加current样式，完成操作内容后会显示完成时间-->

								<dl class='step-first <egt name="order_info['order_state']" value='0'>current</egt>'>
									<dt>拍下商品</dt>
									<dd class="step-bg"></dd>
									<dd class="date" title="下单时间"><notempty name="order_info['add_time']">{:date('Y-m-d H:i:s',$order_info['add_time'])}</notempty></dd>
								</dl>
								<dl class=' <egt name="order_info['order_state']" value='20'>current</egt>'>
									<dt>买家付款</dt>
									<dd class="step-bg"></dd>
									<dd class="date" title="买家付款时间"><notempty name="order_info['payment_time']">{:date('Y-m-d H:i:s',$order_info['payment_time'])}</notempty></dd>
								</dl>
								<dl class=' <egt name="order_info['order_state']" value='30'>current</egt>'>
									<dt>商家发货</dt>
									<dd class="step-bg"></dd>
									<dd class="date" title="商家发货时间"><notempty name="order_info['shipping_time']">{:date('Y-m-d H:i:s',$order_info['shipping_time'])}</notempty></dd>
								</dl>
								<dl class=' <egt name="order_info['order_state']" value='40'>current</egt>'>
									<dt>确认收货</dt>
									<dd class="step-bg"></dd>
									<dd class="date" title="确认收货时间"><notempty name="order_info['finnshed_time']">{:date('Y-m-d H:i:s',$order_info['finnshed_time'])}</notempty></dd>
								</dl>
								<dl class='<egt name="order_info['order_state']" value='40'><eq name="order_info['evaluation_state']" value='1'>current</eq><eq name="order_info['evaluation_state']" value='2'>current</eq></egt>'>
									<dt>买家评价</dt>
									<dd class="step-bg"></dd>
								</dl>
							</div>
							<div class="trade-details">
								<table class="trade-details-table" cellspacing="0" cellpadding="0">
									<tbody>
										<tr>
											<td class="table-td trade-imfor">
												<div class="trade-imfor-title">
													<h3>订单信息</h3>
												</div>
												<ul>
													<li class="table-list">
														<div class="trade-imfor-dt">收货地址：</div>
														<div class="trade-imfor-dd">
															<php>
																$ProvinceInfo=getProvinceInfo($order_info['buyer_province']); $CityInfo=getCityInfo($order_info['buyer_city']); $DistrictInfo=getDistrictInfo($order_info['buyer_district']);
															</php>
															<div class="address-detail">{$order_info['buyer_name']}，{$ProvinceInfo['province_name']} {$CityInfo['city_name']} {$DistrictInfo['district_name']} {$order_info['buyer_address']}</div>
														</div>
													</li>
													<li class="table-list">
														<div class="trade-imfor-dt">收货电话：</div>
														<div class="trade-imfor-dd">
															<div class="address-detail">{$order_info['buyer_mobile']}</div>
														</div>
													</li>
													<li class="table-list">
														<div class="trade-imfor-dt">买家留言：</div>
														<div class="trade-imfor-dd message-detail">
															<span class="no-content">{$order_info['leavemessage']|default='无留言'}</span>
														</div>
													</li>

													<li class="table-list separate-top">
														<div class="trade-imfor-dt">订单编号：</div>
														<div class="trade-imfor-dd imfor-short-dd">{$order_num}</div>

													</li>

													<li class="table-list">
														<div class="trade-imfor-dt">支付方式：</div>
														<div class="trade-imfor-dd message-detail">
															<span class="no-content">{$order_info['payment_code']}</span>
														</div>
													</li>

													<li class="table-list">
														<div class="trade-imfor-dt">商家信息：</div>
														<div class="trade-imfor-dd imfor-short-dd">
															<span class="short-dd-nick" title="{$order_info['store_name']}">{$order_info['store_name']}</span>
														</div>
													</li>
												</ul>
											</td>
											<td class="table-td">
												<dl class="user-status-imfor">
													<dt class="imfor-icon">
														<!-- 订单完成的图标 -->
														<lt name="order_info['order_state']" value="40"><img src="/themes/wnsc/Home/User/images/warning.png"></lt>
														<egt name="order_info['order_state']" value="40"><img src="/themes/wnsc/Home/User/images/success.png"></egt>
														
													
													</dt>
													<php>
														if($order_info['tuanselect']==1){
															if($order_info['tuan_is_first_id']==0){
																$num=get_tuan($order_info['order_id']);
															}else{
																$num=get_tuan($order_info['tuan_is_first_id']);
															}
														}
													</php>
													<dd class="imfor-title">
														<eq name="order_info['refund_state']" value="0">
															<eq name="order_info['order_state']" value="0">
																<h3>订单状态：已取消</h3>
															</eq>
															<eq name="order_info['order_state']" value="10">
																<h3>订单状态：商品已拍下，等待买家付款</h3>
															</eq>
															<eq name="order_info['order_state']" value="20">
																<eq name="order_info['refund_state']" value="0">
																	<php>if($order_info['tuanselect']==1&&$num<$order_info['tuannum']){</php>
																		<h3>订单状态：商品已付款，拼团中，还差{$order_info['tuannum']-$num}人，快去邀请小伙伴吧！</h3>
																	<php>}elseif($order_info['tuanselect']==1&&$num==$order_info['tuannum']){</php>
																		<h3>订单状态：拼团成功,等待卖家发货</h3>
																	<php>}else{</php>
																		<h3>订单状态：商品已付款，等待卖家发货</h3>
																	<php>}</php>
																</eq>
																
															</eq>
															<eq name="order_info['order_state']" value="30">
																<h3>订单状态：商品已发货，等待卖家收货</h3>
															</eq>
															<eq name="order_info['order_state']" value="40">
																
																	<eq name="order_info['evaluation_state']" value="0">
																		<h3>订单状态：商品已收货，等待卖家评价</h3>
																	</eq>
																	<eq name="order_info['evaluation_state']" value="1">
																		<h3>订单状态：已评价</h3>
																	</eq><eq name="order_info['evaluation_state']" value="2">
																		<h3>订单状态：交易结束</h3>
																	</eq>
																
																	
															</eq>
														</eq>
														<neq name="order_info['refund_state']" value="0">
															<eq name="order_info['refund_state']" value="1">
																<h3>订单状态：退款中</h3>
															</eq>
															<eq name="order_info['refund_state']" value="2">
																<h3>订单状态：已同意</h3>
															</eq>
															<eq name="order_info['refund_state']" value="3">
																<h3>订单状态：已拒绝退款</h3>
															</eq>
															<eq name="order_info['refund_state']" value="4">
																<h3>订单状态：等待客服打款</h3>
															</eq>
															<eq name="order_info['refund_state']" value="5">
																<h3>订单状态：退款/货完成</h3>
															</eq>
														</neq>
													</dd>
												</dl>
												<eq name="order_info['refund_state']" value="0">
													<neq name="order_info['order_state']" value="0">
													<dl class="user-status-operate">
														<!-- 不同的交易状态 -->
	
														<dt>您可以</dt>
														<eq name="order_info['order_state']" value="10">
															<dd>
																<a href="{:U('pay/paychoose',array('order_cn'=>$order_num))}" class="on-payment">立即付款</a>
															</dd>
															<dd>
																<a href="{:U('user/close_order',array('order_cn'=>$order_num))}">取消订单</a>
															</dd>
														</eq>
														<eq name="order_info['order_state']" value="20">
															<dd>
																<eq name="order_info['refund_state']" value="0">
																<php>if($order_info['tuanselect']==1&&$num<$order_info['tuannum']){</php>
																	<a href="javascript:;" class="on-payment lijiyaoqin">立即邀请</a>
																<php>}elseif($order_info['tuanselect']==1&&$num==$order_info['tuannum']){</php>
																	<a href="javascript:;" class="on-payment">等待发货</a>
																<php>}else{</php>
																	<a href="javascript:;" class="on-payment">等待发货</a>
																<php>}</php>
																</eq>
																
															</dd>
														</eq>
														<eq name="order_info['order_state']" value="30">
															<dd>
																<a href="javascript:;" class="on-payment"onclick="operation('logistics',{$order_info['order_id']})">查看物流</a>
																<a href="javascript:;" class="on-payment confirm_order">确认收货</a>
															</dd>
														</eq>
														<eq name="order_info['order_state']" value="40">
															<eq name="order_info['refund_state']" value="0">
																<eq name="order_info['evaluation_state']" value="0">
																	<dd>
																		<a href="{:U('user/reviewcommodity',array('id'=>$order_info['order_id']))}" class="on-payment confirm_order">立即评价</a>
																	</dd>
																</eq>
																<eq name="order_info['evaluation_state']" value="1">
																	<dd>
																		<a href="{:U('user/reviewagain',array('id'=>$order_info['order_id']))}" class="on-payment confirm_order">追加评价</a>
																	</dd>
																</eq>
																<eq name="order_info['evaluation_state']" value="2">
																	<dd>
																		<a href="javascript:;" class="on-payment confirm_order">交易结束</a>
																	</dd>
																</eq>
															</eq>
															
														</eq>
													
	
													</dl>
													</neq>
												</eq>
												<neq name="order_info['refund_state']" value="0">
													<dl class="user-status-operate">
													<eq name="order_info['refund_state']" value="1">
														<a href="javascript:;" class="on-payment">等待退款</a>
													</eq>
													<gt name="order_info['refund_state']" value="0">
														<dd>
															<a href="{:U('user/refunddetail',array('order_id'=>$order_info['order_id']))}" class="on-payment ">查看详情</a>
														</dd>
														<dd style="margin-top: 10px;line-height: 28px;">1、退款中，如果你还未收到钱，或者收到的钱数目不对，请及时联系卖家协商处理。<br/>2、如果卖家没有解决你的上述问题，你可以在确认收货后的15天内发起售后维权，要求客服介入处理。400-870-3150 周一至周五(9:00-22:00)</dd>
													</gt>
													</dl>
												</neq>
											</td>
										</tr>
									</tbody>
								</table>
							</div>
							<div class="bought-listform">
								<dl class="bought-listform-header ">
									<dd class="header-item">商品</dd>
									<dd class="header-price">单价（元）</dd>
									<dd class="header-count">数量</dd>
									<dd class="header-favorable">优惠（元）</dd>
									<dd class="header-status">状态</dd>
									<dd class="header-logistics">运费（元）</dd>
								</dl>

								<table class="bought-goods-list " cellspacing="0" cellpadding="0">
									<tbody>
										<tr>
											<td class="header-content-detail">
												<ul>
													<li class="bought-listform-content ">

														<table cellspacing="0" cellpadding="0">
															<tbody>
																<foreach name="order_goods_info" item="vo">
																	<tr>
																		<td class="header-item">
																			<div class="item-container clearfix">
																				<div class="item-img">
																					<a class="pic s50" href="{:U('shop/index',array('id'=>$vo['goods_id']))}" target="_blank">
																						<img src="{$vo['goods_image']}">
																					</a>
																				</div>
																				<div class="item-meta">

																						<a class="item-link" href="{:U('shop/index',array('id'=>$vo['goods_id']))}" target="_blank">
																						{$vo['goods_name']}
																					</a>

																					<div class="item-props">
																						<span class="sku">
																						<notempty name="vo.goods_sku_spec"><span>规格：{$vo.goods_sku_spec}</span></notempty>&nbsp;
																						<notempty name="vo.goods_sku_style"><span>颜色：{$vo.goods_sku_style}</span></notempty>
																						</span>
																					</div>
																				</div>
																			</div>
																		</td>
																		<td class="header-price font-high-light">￥{$vo.goods_price}</td>
																		<td class="header-count font-high-light">{$vo.goods_num}</td>
																		<td class="header-favorable font-high-light">
																			<div class="favorable-hight-light">￥{$youhui_price+$vo['recommend_price']}</div>
																		</td>
																		<td class="header-status font-high-light">
																			<div class="font-black">
																				<eq name="order_info['order_state']" value="0">
																					<div class="operate" style="color: red;">已取消</div>
																					<div class="operate">
																						<a href="{:U('shop/index',array('id'=>$vo['goods_id']))}">再次购买</a>
																					</div>
																				</eq>
																				<eq name="order_info['order_state']" value="10">
																					<div class="operate">
																						<a href="javascript:;" target="_blank" class="on-payment">待付款</a>
																					</div>
																				</eq>
																				<eq name="order_info['order_state']" value="20">
																					<div class="operate">
																						<a href="javascript:;" target="_blank" class="on-payment">等待发货</a>
																					</div>
																				</eq>
																				<eq name="order_info['order_state']" value="30">
																					<div class="operate">
																						<a href="javascript:;" target="_blank" class="on-payment">确认收货</a>
																					</div>
																				</eq>
																				<eq name="order_info['order_state']" value="40">
																					<eq name="order_info['evaluation_state']" value="0">
																						<div class="operate">
																							<a href="{:U('user/reviewcommodity',array('id'=>$order_info['order_id']))}" class="on-payment">立即评价</a>
																						</div>
																					</eq>
																					<eq name="order_info['evaluation_state']" value="1">
																						<div class="operate">
																							<a href="{:U('user/reviewagain',array('id'=>$order_info['order_id']))}" class="on-payment">追加评价</a>
																						</div>
																					</eq><eq name="order_info['evaluation_state']" value="2">
																						<div class="operate">
																							<a href="javascript:;" class="on-payment">交易结束</a>
																						</div>
																					</eq>
																				</eq>

																			</div>
																		</td>
																		<td class="header-status font-high-light">
																			<div class="font-high-light">￥{$vo['freight']}</div>

																			<div class="font-high-light">( 快递 )</div>

																		</td>
																	</tr>
																	<php>
																		$count_fee=$count_fee+$vo['freight']; 
																		$count_price=$count_price+($vo['goods_price']*$vo['goods_num']);
																		
																	</php>
																</foreach>

															</tbody>
														</table>
													</li>
												</ul>
											</td>

										</tr>

									</tbody>
								</table>
							</div>
							<div class="order-total">

								<div class="total-count">

									<div class="total-count-pay">

										<div class="total-count-pay-info">
											<span>商品总额：￥{$count_price}</span>
											<em>+</em>
											<span>运费: ￥{$count_fee}</span>
											<em>-</em>
											<span>优惠券：￥{$youhui_price}</span>
											<em>-</em>
											<span>抵扣券：￥{$order_info['daiyan_sale']}</span>
											
											<php>
												$zong_price=$count_price-$youhui_price-$order_info['daiyan_sale']+$count_fee;
												if($zong_price<0){
													$zong_price=0.00;
												}
											</php>
											<em>=</em>
											<span class="end second-color">订单总金额：￥{$zong_price}</span>
										</div>

									</div>
								</div>
							</div>
						</div>
					</div>
				</div>

			</div>
		</div>
		<div style="clear: both;"></div>

		<tc_include file="Public:footer" />
		<script src="/Store/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="/Store/css/order/op_express.css"/>
		<input type="hidden"  id="order_id" value="{$order_info['order_id']}" />
		
			<div class="modal fade" id="orderlogistics" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none;height: 510px;">
				<div class="modal-dialog" style="width: 50%;margin-top: 0;">
					<div class="modal-content">
						<div class="modal-header" style="float: left;width: 96%;">
							<button type="button" class="close_wuliu close" style="margin-top: 1px;position: absolute;right: 4px;z-index: 99999999;">×</button>
							<h4 class="modal-title" id="myModalLabel" style="float: left;height: 23px;">物流信息</h4>
							<div style="float: right;height: 30px;line-height: 30px;padding-right: 22px;">物流单号:{$order_info['shipping_code']}&nbsp;({$order_info['shipping_name']})</div>
						</div>
						<div class="modal-body">

							<div style="clear:both;"></div>
							<div class="form-group" id="express_input" style="height: 330px;overflow: auto;padding: 30px;">
								<div class="op_express_delivery_main" style="display: block;height: 330px;overflow: auto;">
									<div class="op_express_delivery_main_container" style="display: block;height: 330px;overflow: auto;">
										<div class="op_express_delivery_main_content opui-scroll-ctrl-content opui-scroll-onwheel"  style="display: block;height: 330px;overflow: auto;">
											<div style="zoom: 1;">
												<ul class="op_express_delivery_timeline_box"></ul>
											</div>
										</div>
										
									</div>
								</div>
							</div>
							<div id="receiver_info"></div>
						</div>

						<div class="modal-footer" style="padding: 10px 20px;">
							<button type="button" class="btn btn-info close_wuliu" data-dismiss="modal" style="display:inline-block;background: red!important;color: #fff;border: none;">关闭</button>
						</div>
					</div>
				</div>
			</div>

		<script type="text/javascript">
			$(function(){
				$('.lijiyaoqin').click(function(){
					$('.mark').show();
					$('.share-dialog').show();
				})
				$('.share-close').click(function(){
					$('.mark').hide();
					$('.share-dialog').hide();
				})
				$('.confirm_order').click(function(){
					var order_id=$('#order_id').val();
					$.ajax({
						type:"post",
						url:"{:U('user/confirm_order')}",
						data:{'order_id':order_id},
						async:true,
						success:function(data){
							if(data.code==1){
								layer.msg(data.message)
								setTimeout('window.location.href="{:U('User/order',array('stauts'=>4))}"',1000);
							}
							if(data.code==0){
								layer.msg(data.message)
							}
						}
					});
				})
				$('.close_wuliu').click(function(){
					$("#orderlogistics").hide();
					$(".modal-backdrop").remove();
				})
				
			})
			
			function operation(operation_type, order_id) {
					if(operation_type == 'logistics') {
						orderlogistics(order_id); //查看物流
					}
				}
				function orderlogistics(order_id) {
					$("#orderlogistics").show();
					$('body').append('<div class="modal-backdrop fade in"></div>')
					var order_id = order_id;
					$.ajax({
						type: "post",
						url: "/user/get_orderlogistics.html",
						data: {
							"order_id": order_id
						},
						beforeSend: function() {
							html = '<div class="silider-express" style="padding: 77px;">';
							html += '<div class="mask-layer-loading" style="text-align:center;">';
							html += '<img src="/store/css/order/mask_load.gif"/>';
							html += '<div style="text-align:center;margin-top:10px;">努力加载中...</div>';
							html += '</div>';
							html += '</div>';
							$('.op_express_delivery_timeline_box').html(html);
							
						},
						success: function(data) {
							var data = eval('(' + data + ')'); 
							var traces=data.Traces;
							if(traces.length>0){
								var newhtml ='';
								for (var i = 0 ; i <traces.length; i++) {
									var html ='';
									if(i==traces.length-1){
										html+= '<li class="op_express_delivery_timeline_new c-clearfix">';
										html+= '<div class="op_express_delivery_timeline_title">';
										html+= '<div class="op_express_delivery_timeline_circle"><i class="c-icon op_express_delivery_timeline_circle_red"></i><i class="c-text c-text-danger c-text-mult c-gap-left-small">最新</i></div>';
									}else{
										html+= '<li class="op_express_delivery_timeline_label c-clearfix">';
										html+= '<div class="op_express_delivery_timeline_title">';
										html+= '<div class="op_express_delivery_timeline_circle"><i class="c-icon op_express_delivery_timeline_circle_blue"></i></div>';
									}
									
									
									html+= '<div class="op_express_delivery_timeline_info">'+traces[i]['AcceptTime']+'<br>'+traces[i]['AcceptStation']+'</div>';
									html+= '</div></li>';
									newhtml=html+newhtml;
								}
								
							}else{
								var newhtml ='';
								newhtml = '<div class="silider-express" style="padding: 77px;">';
								newhtml += '<div class="mask-layer-loading" style="text-align:center;">';
								newhtml += '<div style="text-align:center;margin-top:10px;">没有物流信息...</div>';
								newhtml += '</div>';
								newhtml += '</div>';
							}
							$('.op_express_delivery_timeline_box').html(newhtml);
						}
					});
				}
			

		</script>
		
		<link rel="stylesheet" type="text/css" href="/themes/wnsc/Home/Shop/css/share.css"/>
		<div class="mark" style="display: none;"></div>
		<div class="share-dialog" style="display: none;">
		    <div class="share-close"></div>
		    <div class="share-dialog-title">拼团邀请</div>
		    <div class="share-dialog-cont">
		        <div class="share-copy">
		            <div class="share-copy-l">分享链接：</div>
		            <div class="share-copy-c"><input id="copytext" type="text"/></div>
		            <div id="btnCopy" class="share-copy-r"  data-clipboard-target="copytext">复制链接</div>
		            <div class="clear"></div>
		        </div>
		        <div class="share-platform">
		            <div class="share-platform-l">社交平台：</div>
		            <div class="share-platform-r">
		                <div class="bdsharebuttonbox">
		                    <a href="#" id="share-qrcode" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
		                    <a href="#" id="share-sina" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
		                    <a href="#" id="share-qq" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a>
		                    <a href="#" id="share-qzone" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
		                </div>
		                <div class="share-platform-text">
		                    您可以直接复制短链，分享给朋友，也可直接点击社交平台图标，指定分享。
		                </div>
		            </div>
		        </div>
		    </div>
		</div>
			<script>
				var g_url = "http://{$_SERVER['SERVER_NAME']}{:U('shop/ctuan',array('id'=>$order_info['order_id']))}";
			</script>
			<link rel="stylesheet" type="text/css" href="/themes/wnsc/Home/Shop/css/share_style.css"/>
			<script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
			<script src="/themes/wnsc/Home/Shop/js/jsmodern-1.1.1.min.js"></script>
			
			<script type="text/javascript">
				jsModern.share({
				    qrcode: "#share-qrcode",
				    douban: "#share-douban",
				    qzone: "#share-qzone",
				    sina: "#share-sina",
				    qq: "#share-qq",
				    bdText:"【仅剩{$order_info['tuannum']-$num}个名额】我{$order_goods_info.0.goods_price}元拼了{$order_goods_info.0.goods_name}",
				    bdUrl:g_url,
				    bdPic:"http://{$_SERVER['SERVER_NAME']}{$order_goods_info.0.goods_image}",
				});
			</script>
			
	
		  
		    <script src="/themes/wnsc/Home/Shop/css/ZeroClipboard.js"></script>
			<script>
				
			    $('.share-copy-c input').val(g_url);
			   
				var clip = new ZeroClipboard( document.getElementById("btnCopy"),{
					moviePath: '/themes/wnsc/Home/Shop/css/ZeroClipboard.swf'
				});
				clip.on('ready', function(){
				    this.on('aftercopy', function(event){
				    	layer.msg('已经复制剪贴板');
				    });
				});
				
			
			</script>
	</body>

</html>